<?php if(!defined('BASEPATH'))exit('No direct script access allowed');if(!function_exists('element')){function element($item,$array,$default=FALSE){if(!isset($array[$item])OR $array[$item]==""){return $default;}return $array[$item];}}if(!function_exists('random_element')){function random_element($array){if(!is_array($array)){return $array;}return $array[array_rand($array)];}}if(!function_exists('elements')){function elements($items,$array,$default=FALSE){$return=array();if(!is_array($items)){$items=array($items);}foreach($items as $item){if(isset($array[$item])){$return[$item]=$array[$item];}else{$return[$item]=$default;}}return $return;}}